// JavaScript Document
var handlerPath = '/administration/core/home_handler.aspx';


function CaricaArticoli() {
	var myRequest = new Request(
		{
			method: 'get', 
			url: handlerPath,	
			onSuccess: function(text,xml) {
				if(text==null) {alert('no load'); return; }
				if(xml==null) {alert('xml no load'); return; }						
				var cXml;
				if (window.ActiveXObject)
				{
					var xmlObj=new ActiveXObject("Microsoft.XMLDOM");
					xmlObj.async="false";
					xmlObj.loadXML(text);
					if(xmlObj.documentElement == null) {	alert('sono nullo'); return; }
					cXml = xmlObj.documentElement;		
				} else {
					cXml = xml.documentElement;
				}						
				if(cXml == null) { alert('no data');return; }
				var contenitore = $('artContEna');
				if(!contenitore) { return; }
				var _table = new Element('table');
				var _tbody = new Element('tbody');
				var _thead = new Element('thead');
				var _trh   = new Element('tr');
				//var htd0 = new Element('td');
				var htd1 = new Element('td');
				var htd2 = new Element('td');
				var htd3 = new Element('td');
				var htd4 = new Element('td');
				var htd5 = new Element('td');				
				//htd0.set('html', ' ');
				htd1.set('html', 'Titolo');						
				htd2.set('html', 'Autore');												
				htd3.set('html', ' ' );																		
				htd4.set('html', 'ult. modifica');																								
				htd5.set('html', 'stato');																												
				//_trh.adopt(htd0);
				_trh.adopt(htd1);_trh.adopt(htd2);_trh.adopt(htd3);_trh.adopt(htd4);_trh.adopt(htd5);
				_thead.adopt(_trh);
				_table.adopt(_thead);
				_table.adopt(_tbody);
				var conto = 0;
				for(var i = 0 ; i<cXml.childNodes.length; i++ ) {
					if (cXml.childNodes[i].nodeType != 1) continue;
					if( cXml.childNodes[i].nodeName == 'dato') {
						//data_mod,titolo,id, enabled, autorename, autore, editorname, upd_id
						var data_obj = {'titolo':'', 'id':'','enabled':'', 'autorename':'', 'autore':'', 'editorname':'', 'upd_id':'','deleting':'', 'data_mod':'',
										'newrec':'','sezioname':'','catename':'','lingua':'','url':''
						}
						var elem = cXml.childNodes[i];
						for(var j=0; j<elem.childNodes.length;j++) {
							if (elem.childNodes[j].nodeType != 1) continue;
							if( elem.childNodes[j].nodeName == 'titolo')
								data_obj.titolo = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'id')
								data_obj.id = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'enabled')
								data_obj.enabled = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'autorename')
								data_obj.autorename = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'autore')
								data_obj.autore = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'editorname')
								data_obj.editorname = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'upd_id')
								data_obj.upd_id = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'data_mod')
								data_obj.data_mod = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'deleting')
								data_obj.deleting = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'newrec')
								data_obj.newrec = elem.childNodes[j].firstChild.nodeValue;			
							if( elem.childNodes[j].nodeName == 'sezioname')
								data_obj.sezioname = elem.childNodes[j].firstChild.nodeValue;	
							if( elem.childNodes[j].nodeName == 'catename')
								data_obj.catename = elem.childNodes[j].firstChild.nodeValue;	
							if( elem.childNodes[j].nodeName == 'lingua')
								data_obj.lingua = elem.childNodes[j].firstChild.nodeValue;	
							if( elem.childNodes[j].nodeName == 'url')
								data_obj.url = elem.childNodes[j].firstChild.nodeValue;	
						}
						var tr = new Element('tr');
						var autor = '';
						if(data_obj.editorname && data_obj.editorname!='') 
							autor= '<a href="?id='+data_obj.upd_id+'">'+data_obj.editorname+'</a><br/>';
						autor +='<a href="?id='+data_obj.autore+'">'+data_obj.autorename+'</a>';
						var title = '<a href="' + data_obj.url + '" title="'+data_obj.titolo+'">'+data_obj.titolo+' [' + data_obj.lingua+']</a><br/>'+
							data_obj.sezioname+' - '+data_obj.catename;
						var stato = 
							(data_obj.deleting=='N' && data_obj.upd_id!='-1'?'<span>Nuove Modifiche</span>':'') +
							(data_obj.deleting=='N' && data_obj.upd_id=='-1'?'<span>Nuovo Articolo</span>':'') + 
							(data_obj.deleting=='1'?'<span>Eliminazione richiesta</span>':'')
							
						;
						
						var td0 = new Element('td');
						var td1 = new Element('td');
						var td2 = new Element('td');
						var td3 = new Element('td');
						var td4 = new Element('td');
						var td5 = new Element('td');		
						
						
						
						td1.set('html', 
								(data_obj.newrec!='0'?'<img src="/administration/template/img/ico_new.gif" alt="new" width="15" />':'') + 
								title);						
						td2.set('html', autor);												
						td3.set('html', '<img src="/administration/template/img/ico_ena_'+data_obj.enabled + '.gif" alt="'+data_obj.enabled+'" width="15" />');																		
						td4.set('html', data_obj.data_mod);					
						td5.set('html', stato);											
						tr.adopt(td1);tr.adopt(td2);tr.adopt(td3);tr.adopt(td4);tr.adopt(td5);
						_tbody.adopt(tr);conto++;
					}
				}
				
				contenitore.adopt(new Element('h6').set('html','Articoli da Revisionare') ) ;					
				if(conto==0) {
					contenitore.adopt(new Element('h6').set('html','Nessun articolo da visualizzare') ) ;					
					
				}else
					contenitore.adopt(_table);
			} 
			
		}).send('op=newartlist');	
}

function CaricaArticoliEdited() {
	var myRequest = new Request(
		{
			method: 'get', 
			url: handlerPath,	
			onSuccess: function(text,xml) {
				if(text==null) {alert('no load'); return; }
				if(xml==null) {alert('xml no load'); return; }						
				var cXml;
				if (window.ActiveXObject)
				{
					var xmlObj=new ActiveXObject("Microsoft.XMLDOM");
					xmlObj.async="false";
					xmlObj.loadXML(text);
					if(xmlObj.documentElement == null) {	alert('sono nullo'); return; }
					cXml = xmlObj.documentElement;		
				} else {
					cXml = xml.documentElement;
				}						
				if(cXml == null) { alert('no data');return; }
				var contenitore = $('artContMod');
				if(!contenitore) { return; }
				var _table = new Element('table');
				var _tbody = new Element('tbody');
				var _thead = new Element('thead');
				var _trh   = new Element('tr');
				//var htd0 = new Element('td');
				var htd1 = new Element('td');
				var htd2 = new Element('td');
				var htd3 = new Element('td');
				var htd4 = new Element('td');
				var htd5 = new Element('td');				
				//htd0.set('html', ' ');
				htd1.set('html', 'Titolo');						
				htd2.set('html', 'Autore');												
				htd3.set('html', ' ' );																		
				htd4.set('html', 'ult. modifica');																								
				htd5.set('html', 'stato');																												
				//_trh.adopt(htd0);
				_trh.adopt(htd1);_trh.adopt(htd2);_trh.adopt(htd3);_trh.adopt(htd4);_trh.adopt(htd5);
				_thead.adopt(_trh);
				_table.adopt(_thead);
				_table.adopt(_tbody);
				var conto = 0;
				for(var i = 0 ; i<cXml.childNodes.length; i++ ) {
					if (cXml.childNodes[i].nodeType != 1) continue;
					if( cXml.childNodes[i].nodeName == 'dato') {
						//data_mod,titolo,id, enabled, autorename, autore, editorname, upd_id
						var data_obj = {'titolo':'', 'id':'','enabled':'', 'autorename':'', 'autore':'', 'editorname':'', 'upd_id':'','deleting':'', 'data_mod':'',
										'newrec':'','sezioname':'','catename':'','lingua':'','url':''
						}
						var elem = cXml.childNodes[i];
						for(var j=0; j<elem.childNodes.length;j++) {
							if (elem.childNodes[j].nodeType != 1) continue;
							if( elem.childNodes[j].nodeName == 'titolo')
								data_obj.titolo = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'id')
								data_obj.id = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'enabled')
								data_obj.enabled = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'autorename')
								data_obj.autorename = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'autore')
								data_obj.autore = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'editorname')
								data_obj.editorname = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'upd_id')
								data_obj.upd_id = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'data_mod')
								data_obj.data_mod = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'deleting')
								data_obj.deleting = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'newrec')
								data_obj.newrec = elem.childNodes[j].firstChild.nodeValue;			
							if( elem.childNodes[j].nodeName == 'sezioname')
								data_obj.sezioname = elem.childNodes[j].firstChild.nodeValue;	
							if( elem.childNodes[j].nodeName == 'catename')
								data_obj.catename = elem.childNodes[j].firstChild.nodeValue;	
							if( elem.childNodes[j].nodeName == 'lingua')
								data_obj.lingua = elem.childNodes[j].firstChild.nodeValue;	
							if( elem.childNodes[j].nodeName == 'url')
								data_obj.url = elem.childNodes[j].firstChild.nodeValue;	
						}
						var tr = new Element('tr');
						var autor = '';
						
						if(data_obj.editorname && data_obj.editorname!='') 
							autor= '<a href="?id='+data_obj.upd_id+'">'+data_obj.editorname+'</a><br/>';
						autor +='<a href="?id='+data_obj.autore+'">'+data_obj.autorename+'</a>';
						var title = '<a href="' + data_obj.url + '" title="'+data_obj.titolo+'">'+data_obj.titolo+' [' + data_obj.lingua+']</a><br/>'+
							data_obj.sezioname+' - '+data_obj.catename;
						var stato = 
							(data_obj.deleting=='N' && data_obj.upd_id!='-1'?'<span>Nuove Modifiche</span>':'') +
							(data_obj.deleting=='N' && data_obj.upd_id=='-1'?'<span>Nuovo Articolo</span>':'') + 
							(data_obj.deleting=='1'?'<span>Eliminazione richiesta</span>':'')
						;
						
						var td0 = new Element('td');
						var td1 = new Element('td');
						var td2 = new Element('td');
						var td3 = new Element('td');
						var td4 = new Element('td');
						var td5 = new Element('td');	
												
						td1.set('html', 
								(data_obj.newrec!='0'?'<img src="/administration/template/img/ico_new.gif" alt="new" width="15" />':'') + 
								title);						
						td2.set('html', autor);												
						td3.set('html', '<img src="/administration/template/img/ico_ena_'+data_obj.enabled + '.gif" alt="'+data_obj.enabled+'" width="15" />');																		
						td4.set('html', data_obj.data_mod);					
						td5.set('html', stato);											
						tr.adopt(td1);tr.adopt(td2);tr.adopt(td3);tr.adopt(td4);tr.adopt(td5);
						_tbody.adopt(tr);conto++;
					}
				}
				
				contenitore.adopt(new Element('h6').set('html','Articoli Modificati di recente') ) ;					
					
				if(conto==0){
					contenitore.adopt(new Element('h6').set('html','Nessun articolo da visualizzare') ) ;					
					
				}else
					contenitore.adopt(_table);
			} 
		}).send('op=lastartlist');	
}
function CaricaCategorie() {
	var myRequest = new Request(
		{
			method: 'get', 
			url: handlerPath,	
			onSuccess: function(text,xml) {
				if(text==null) {alert('no load'); return; }
				if(xml==null) {alert('xml no load'); return; }						
				var cXml;
				if (window.ActiveXObject)
				{
					var xmlObj=new ActiveXObject("Microsoft.XMLDOM");
					xmlObj.async="false";
					xmlObj.loadXML(text);
					if(xmlObj.documentElement == null) {	alert('sono nullo'); return; }
					cXml = xmlObj.documentElement;		
				} else {
					cXml = xml.documentElement;
				}						
				if(cXml == null) { alert('no data');return; }
				var contenitore = $('catContEna');
				if(!contenitore) {  return; }
				var _table = new Element('table');
				var _tbody = new Element('tbody');
				var _thead = new Element('thead');
				var _trh   = new Element('tr');
				//var htd0 = new Element('td');
				var htd1 = new Element('td');
				var htd2 = new Element('td');
				var htd3 = new Element('td');
				var htd4 = new Element('td');
				var htd5 = new Element('td');				
				//htd0.set('html', ' ');
				htd1.set('html', 'Titolo');						
				htd2.set('html', 'Autore');												
				htd3.set('html', ' ' );																		
				htd4.set('html', 'ult. modifica');																								
				htd5.set('html', 'stato');																												
				//_trh.adopt(htd0);
				_trh.adopt(htd1);_trh.adopt(htd2);_trh.adopt(htd3);_trh.adopt(htd4);_trh.adopt(htd5);
				_thead.adopt(_trh);
				_table.adopt(_thead);
				_table.adopt(_tbody);
				var conto = 0;
				for(var i = 0 ; i<cXml.childNodes.length; i++ ) {
					if (cXml.childNodes[i].nodeType != 1) continue;
					if( cXml.childNodes[i].nodeName == 'dato') {
						//data_mod,titolo,id, enabled, autorename, autore, editorname, upd_id
						var data_obj = {'titolo':'', 'id':'','enabled':'', 'autorename':'', 'autore':'', 'editorname':'', 'upd_id':'','deleting':'', 'data_mod':'',
										'newrec':'','url':''
						}
						var elem = cXml.childNodes[i];
						for(var j=0; j<elem.childNodes.length;j++) {
							if (elem.childNodes[j].nodeType != 1) continue;
							if( elem.childNodes[j].nodeName == 'titolo')
								data_obj.titolo = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'id')
								data_obj.id = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'enabled')
								data_obj.enabled = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'autorename')
								data_obj.autorename = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'autore')
								data_obj.autore = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'editorname')
								data_obj.editorname = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'upd_id')
								data_obj.upd_id = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'data_mod')
								data_obj.data_mod = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'deleting')
								data_obj.deleting = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'newrec')
								data_obj.newrec = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'url')
								data_obj.url = elem.childNodes[j].firstChild.nodeValue;
						}
						var tr = new Element('tr');
						var autor = '';
						if(data_obj.editorname && data_obj.editorname!='') 
							autor= '<a href="?id='+data_obj.upd_id+'">'+data_obj.editorname+'</a><br/>';
						autor +='<a href="?id='+data_obj.autore+'">'+data_obj.autorename+'</a>';
						var title = '<a href="'+data_obj.url+'" title="'+data_obj.titolo+'">'+data_obj.titolo+'</a>';
						var stato = 
							(data_obj.upd_id!='-1'?'<span>Nuove Modifiche</span>':'') + 
							(data_obj.deleting!='0'?'<span>Eliminazione richiesta</span>':'')
						;
						
						var td0 = new Element('td');
						var td1 = new Element('td');
						var td2 = new Element('td');
						var td3 = new Element('td');
						var td4 = new Element('td');
						var td5 = new Element('td');						
						td1.set('html', 
								(data_obj.newrec!='0'?'<img src="/administration/template/img/ico_new.gif" alt="new" width="15" />':'') + 
								title);						
						td2.set('html', autor);												
						td3.set('html', '<img src="/administration/template/img/ico_ena_'+data_obj.enabled + '.gif" alt="'+data_obj.enabled+'" width="15" />');																		
						td4.set('html', data_obj.data_mod);					
						td5.set('html', stato);											
						tr.adopt(td1);tr.adopt(td2);tr.adopt(td3);tr.adopt(td4);tr.adopt(td5);
						_tbody.adopt(tr);conto++;
					}
				}
				
				contenitore.adopt(new Element('h6').set('html','Categorie da Revisionare') ) ;					
					
				if(conto==0){
					contenitore.adopt(new Element('h6').set('html','Nessuna categoria da visualizzare') ) ;					
					
				}else
					contenitore.adopt(_table);
			} 
		}).send('op=newcatlist');	
}
function CaricaCategorieEdited() {
	var myRequest = new Request(
		{
			method: 'get', 
			url: handlerPath,	
			onSuccess: function(text,xml) {
				if(text==null) {alert('no load'); return; }
				if(xml==null) {alert('xml no load'); return; }						
				var cXml;
				if (window.ActiveXObject)
				{
					var xmlObj=new ActiveXObject("Microsoft.XMLDOM");
					xmlObj.async="false";
					xmlObj.loadXML(text);
					if(xmlObj.documentElement == null) {	alert('sono nullo'); return; }
					cXml = xmlObj.documentElement;		
				} else {
					cXml = xml.documentElement;
				}						
				if(cXml == null) { alert('no data');return; }
				var contenitore = $('catContMod');
				if(!contenitore) { return; }
				var _table = new Element('table');
				var _tbody = new Element('tbody');
				var _thead = new Element('thead');
				var _trh   = new Element('tr');
				//var htd0 = new Element('td');
				var htd1 = new Element('td');
				var htd2 = new Element('td');
				var htd3 = new Element('td');
				var htd4 = new Element('td');
				var htd5 = new Element('td');				
				//htd0.set('html', ' ');
				htd1.set('html', 'Titolo');						
				htd2.set('html', 'Autore');												
				htd3.set('html', ' ' );																		
				htd4.set('html', 'ult. modifica');																								
				htd5.set('html', 'stato');																												
				//_trh.adopt(htd0);
				_trh.adopt(htd1);_trh.adopt(htd2);_trh.adopt(htd3);_trh.adopt(htd4);_trh.adopt(htd5);
				_thead.adopt(_trh);
				_table.adopt(_thead);
				_table.adopt(_tbody);
				var conto = 0;
				for(var i = 0 ; i<cXml.childNodes.length; i++ ) {
					if (cXml.childNodes[i].nodeType != 1) continue;
					if( cXml.childNodes[i].nodeName == 'dato') {
						//data_mod,titolo,id, enabled, autorename, autore, editorname, upd_id
						var data_obj = {'titolo':'', 'id':'','enabled':'', 'autorename':'', 'autore':'', 'editorname':'', 'upd_id':'','deleting':'', 'data_mod':'',
										'newrec':'','url':''
						}
						var elem = cXml.childNodes[i];
						for(var j=0; j<elem.childNodes.length;j++) {
							if (elem.childNodes[j].nodeType != 1) continue;
							if( elem.childNodes[j].nodeName == 'titolo')
								data_obj.titolo = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'id')
								data_obj.id = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'enabled')
								data_obj.enabled = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'autorename')
								data_obj.autorename = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'autore')
								data_obj.autore = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'editorname')
								data_obj.editorname = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'upd_id')
								data_obj.upd_id = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'data_mod')
								data_obj.data_mod = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'deleting')
								data_obj.deleting = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'newrec')
								data_obj.newrec = elem.childNodes[j].firstChild.nodeValue;	
							if( elem.childNodes[j].nodeName == 'url')
								data_obj.url = elem.childNodes[j].firstChild.nodeValue;	
						}
						var tr = new Element('tr');
						var autor = '';
						if(data_obj.editorname && data_obj.editorname!='') 
							autor= '<a href="?id='+data_obj.upd_id+'">'+data_obj.editorname+'</a><br/>';
						autor +='<a href="?id='+data_obj.autore+'">'+data_obj.autorename+'</a>';
						var title = '<a href="'+data_obj.url+'" title="'+data_obj.titolo+'">'+data_obj.titolo+'</a>';
						var stato = 
							(data_obj.upd_id!='-1'?'<span>Nuove Modifiche</span>':'') + 
							(data_obj.deleting!='0'?'<span>Eliminazione richiesta</span>':'')
						;
						
						var td0 = new Element('td');
						var td1 = new Element('td');
						var td2 = new Element('td');
						var td3 = new Element('td');
						var td4 = new Element('td');
						var td5 = new Element('td');						
						td1.set('html', 
								(data_obj.newrec!='0'?'<img src="/administration/template/img/ico_new.gif" alt="new" width="15" />':'') + 
								title);						
						td2.set('html', autor);												
						td3.set('html', '<img src="/administration/template/img/ico_ena_'+data_obj.enabled + '.gif" alt="'+data_obj.enabled+'" width="15" />');																		
						td4.set('html', data_obj.data_mod);					
						td5.set('html', stato);											
						tr.adopt(td1);tr.adopt(td2);tr.adopt(td3);tr.adopt(td4);tr.adopt(td5);
						_tbody.adopt(tr);conto++;
					}
				}
				
					contenitore.adopt(new Element('h6').set('html','Categorie Modificate di recente') ) ;					
					
				if(conto==0){
					contenitore.adopt(new Element('h6').set('html','Nessuna categoria da visualizzare') ) ;					
					
				}else
					contenitore.adopt(_table);
			} 
		}).send('op=lastcatlist');	
}
function CaricaSezioni() {
	var myRequest = new Request(
		{
			method: 'get', 
			url: handlerPath,	
			onSuccess: function(text,xml) {
				if(text==null) {alert('no load'); return; }
				if(xml==null) {alert('xml no load'); return; }						
				var cXml;
				if (window.ActiveXObject)
				{
					var xmlObj=new ActiveXObject("Microsoft.XMLDOM");
					xmlObj.async="false";
					xmlObj.loadXML(text);
					if(xmlObj.documentElement == null) {	alert('sono nullo'); return; }
					cXml = xmlObj.documentElement;		
				} else {
					cXml = xml.documentElement;
				}						
				if(cXml == null) { alert('no data');return; }
				var contenitore = $('sezContEna');
				if(!contenitore) {  return; }
				var _table = new Element('table');
				var _tbody = new Element('tbody');
				var _thead = new Element('thead');
				var _trh   = new Element('tr');
				//var htd0 = new Element('td');
				var htd1 = new Element('td');
				var htd2 = new Element('td');
				var htd3 = new Element('td');
				var htd4 = new Element('td');
				var htd5 = new Element('td');				
				//htd0.set('html', ' ');
				htd1.set('html', 'Titolo');						
				htd2.set('html', 'Autore');												
				htd3.set('html', ' ' );																		
				htd4.set('html', 'ult. modifica');																								
				htd5.set('html', 'stato');																												
				//_trh.adopt(htd0);
				_trh.adopt(htd1);_trh.adopt(htd2);_trh.adopt(htd3);_trh.adopt(htd4);_trh.adopt(htd5);
				_thead.adopt(_trh);
				_table.adopt(_thead);
				_table.adopt(_tbody);
				var conto = 0;
				for(var i = 0 ; i<cXml.childNodes.length; i++ ) {
					if (cXml.childNodes[i].nodeType != 1) continue;
					if( cXml.childNodes[i].nodeName == 'dato') {
						//data_mod,titolo,id, enabled, autorename, autore, editorname, upd_id
						var data_obj = {'titolo':'', 'id':'','enabled':'', 'autorename':'', 'autore':'', 'editorname':'', 'upd_id':'','deleting':'', 'data_mod':'',
										'newrec':'','url':''
						}
						var elem = cXml.childNodes[i];
						for(var j=0; j<elem.childNodes.length;j++) {
							if (elem.childNodes[j].nodeType != 1) continue;
							if( elem.childNodes[j].nodeName == 'titolo')
								data_obj.titolo = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'id')
								data_obj.id = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'enabled')
								data_obj.enabled = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'autorename')
								data_obj.autorename = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'autore')
								data_obj.autore = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'editorname')
								data_obj.editorname = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'upd_id')
								data_obj.upd_id = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'data_mod')
								data_obj.data_mod = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'deleting')
								data_obj.deleting = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'newrec')
								data_obj.newrec = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'url')
								data_obj.url = elem.childNodes[j].firstChild.nodeValue;
						}
						var tr = new Element('tr');
						var autor = '';
						if(data_obj.editorname && data_obj.editorname!='') 
							autor= '<a href="?id='+data_obj.upd_id+'">'+data_obj.editorname+'</a><br/>';
						autor +='<a href="?id='+data_obj.autore+'">'+data_obj.autorename+'</a>';
						var title = '<a href="'+data_obj.url+'" title="'+data_obj.titolo+'">'+data_obj.titolo+'</a>';
						var stato = 
							(data_obj.upd_id!='-1'?'<span>Nuove Modifiche</span>':'') + 
							(data_obj.deleting!='0'?'<span>Eliminazione richiesta</span>':'')
						;
						
						var td0 = new Element('td');
						var td1 = new Element('td');
						var td2 = new Element('td');
						var td3 = new Element('td');
						var td4 = new Element('td');
						var td5 = new Element('td');						
						td1.set('html', 
								(data_obj.newrec!='0'?'<img src="/administration/template/img/ico_new.gif" alt="new" width="15" />':'') + 
								title);						
						td2.set('html', autor);												
						td3.set('html', '<img src="/administration/template/img/ico_ena_'+data_obj.enabled + '.gif" alt="'+data_obj.enabled+'" width="15" />');																		
						td4.set('html', data_obj.data_mod);					
						td5.set('html', stato);											
						tr.adopt(td1);tr.adopt(td2);tr.adopt(td3);tr.adopt(td4);tr.adopt(td5);
						_tbody.adopt(tr);conto++;
					}
				}
				
				contenitore.adopt(new Element('h6').set('html','Sezioni da Revisionare') ) ;					
					
				if(conto==0){
					contenitore.adopt(new Element('h6').set('html','Nessuna sezione da visualizzare') ) ;					
					
				}else
					contenitore.adopt(_table);
			} 
		}).send('op=newsezlist');	
}
function CaricaSezioniEdited() {
	var myRequest = new Request(
		{
			method: 'get', 
			url: handlerPath,	
			onSuccess: function(text,xml) {
				if(text==null) {alert('no load'); return; }
				if(xml==null) {alert('xml no load'); return; }						
				var cXml;
				if (window.ActiveXObject)
				{
					var xmlObj=new ActiveXObject("Microsoft.XMLDOM");
					xmlObj.async="false";
					xmlObj.loadXML(text);
					if(xmlObj.documentElement == null) {	alert('sono nullo'); return; }
					cXml = xmlObj.documentElement;		
				} else {
					cXml = xml.documentElement;
				}						
				if(cXml == null) { alert('no data');return; }
				var contenitore = $('sezContMod');
				if(!contenitore) {  return; }
				var _table = new Element('table');
				var _tbody = new Element('tbody');
				var _thead = new Element('thead');
				var _trh   = new Element('tr');
				//var htd0 = new Element('td');
				var htd1 = new Element('td');
				var htd2 = new Element('td');
				var htd3 = new Element('td');
				var htd4 = new Element('td');
				var htd5 = new Element('td');				
				//htd0.set('html', ' ');
				htd1.set('html', 'Titolo');						
				htd2.set('html', 'Autore');												
				htd3.set('html', ' ' );																		
				htd4.set('html', 'ult. modifica');																								
				htd5.set('html', 'stato');																												
				//_trh.adopt(htd0);
				_trh.adopt(htd1);_trh.adopt(htd2);_trh.adopt(htd3);_trh.adopt(htd4);_trh.adopt(htd5);
				_thead.adopt(_trh);
				_table.adopt(_thead);
				_table.adopt(_tbody);
				var conto = 0;
				for(var i = 0 ; i<cXml.childNodes.length; i++ ) {
					if (cXml.childNodes[i].nodeType != 1) continue;
					if( cXml.childNodes[i].nodeName == 'dato') {
						//data_mod,titolo,id, enabled, autorename, autore, editorname, upd_id
						var data_obj = {'titolo':'', 'id':'','enabled':'', 'autorename':'', 'autore':'', 'editorname':'', 'upd_id':'','deleting':'', 'data_mod':'',
										'newrec':'', 'url':''
						}
						var elem = cXml.childNodes[i];
						for(var j=0; j<elem.childNodes.length;j++) {
							if (elem.childNodes[j].nodeType != 1) continue;
							if( elem.childNodes[j].nodeName == 'titolo')
								data_obj.titolo = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'id')
								data_obj.id = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'enabled')
								data_obj.enabled = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'autorename')
								data_obj.autorename = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'autore')
								data_obj.autore = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'editorname')
								data_obj.editorname = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'upd_id')
								data_obj.upd_id = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'data_mod')
								data_obj.data_mod = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'deleting')
								data_obj.deleting = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'newrec')
								data_obj.newrec = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'url')
								data_obj.url = elem.childNodes[j].firstChild.nodeValue;
						}
						var tr = new Element('tr');
						var autor = '';
						if(data_obj.editorname && data_obj.editorname!='') 
							autor= '<a href="?id='+data_obj.upd_id+'">'+data_obj.editorname+'</a><br/>';
						autor +='<a href="?id='+data_obj.autore+'">'+data_obj.autorename+'</a>';
						var title = '<a href="'+data_obj.url+'" title="'+data_obj.titolo+'">'+data_obj.titolo+'</a>';
						var stato = 
							(data_obj.upd_id!='-1'?'<span>Nuove Modifiche</span>':'') + 
							(data_obj.deleting!='0'?'<span>Eliminazione richiesta</span>':'')
						;
						
						var td0 = new Element('td');
						var td1 = new Element('td');
						var td2 = new Element('td');
						var td3 = new Element('td');
						var td4 = new Element('td');
						var td5 = new Element('td');						
						td1.set('html', 
								(data_obj.newrec!='0'?'<img src="/administration/template/img/ico_new.gif" alt="new" width="15" />':'') + 
								title);						
						td2.set('html', autor);												
						td3.set('html', '<img src="/administration/template/img/ico_ena_'+data_obj.enabled + '.gif" alt="'+data_obj.enabled+'" width="15" />');																		
						td4.set('html', data_obj.data_mod);					
						td5.set('html', stato);											
						tr.adopt(td1);tr.adopt(td2);tr.adopt(td3);tr.adopt(td4);tr.adopt(td5);
						_tbody.adopt(tr);conto++;
					}
				}
				
					contenitore.adopt(new Element('h6').set('html','Sezioni Modificate di recente') ) ;					
					
				if(conto==0){
					contenitore.adopt(new Element('h6').set('html','Nessuna sezione da visualizzare') ) ;					
					
				}else
					contenitore.adopt(_table);
			} 
		}).send('op=lastsezlist');	
}
function CaricaSezioniEdited() {
	var myRequest = new Request(
		{
			method: 'get', 
			url: handlerPath,	
			onSuccess: function(text,xml) {
				if(text==null) {alert('no load'); return; }
				if(xml==null) {alert('xml no load'); return; }						
				var cXml;
				if (window.ActiveXObject)
				{
					var xmlObj=new ActiveXObject("Microsoft.XMLDOM");
					xmlObj.async="false";
					xmlObj.loadXML(text);
					if(xmlObj.documentElement == null) {	alert('sono nullo'); return; }
					cXml = xmlObj.documentElement;		
				} else {
					cXml = xml.documentElement;
				}						
				if(cXml == null) { alert('no data');return; }
				var contenitore = $('sezContMod');
				if(!contenitore) { return; }
				var _table = new Element('table');
				var _tbody = new Element('tbody');
				var _thead = new Element('thead');
				var _trh   = new Element('tr');
				//var htd0 = new Element('td');
				var htd1 = new Element('td');
				var htd2 = new Element('td');
				var htd3 = new Element('td');
				var htd4 = new Element('td');
				var htd5 = new Element('td');				
				//htd0.set('html', ' ');
				htd1.set('html', 'Titolo');						
				htd2.set('html', 'Autore');												
				htd3.set('html', ' ' );																		
				htd4.set('html', 'ult. modifica');																								
				htd5.set('html', 'stato');																												
				//_trh.adopt(htd0);
				_trh.adopt(htd1);_trh.adopt(htd2);_trh.adopt(htd3);_trh.adopt(htd4);_trh.adopt(htd5);
				_thead.adopt(_trh);
				_table.adopt(_thead);
				_table.adopt(_tbody);
				var conto = 0;
				for(var i = 0 ; i<cXml.childNodes.length; i++ ) {
					if (cXml.childNodes[i].nodeType != 1) continue;
					if( cXml.childNodes[i].nodeName == 'dato') {
						//data_mod,titolo,id, enabled, autorename, autore, editorname, upd_id
						var data_obj = {'titolo':'', 'id':'','enabled':'', 'autorename':'', 'autore':'', 'editorname':'', 'upd_id':'','deleting':'', 'data_mod':'',
										'newrec':'','url':''
						}
						var elem = cXml.childNodes[i];
						for(var j=0; j<elem.childNodes.length;j++) {
							if (elem.childNodes[j].nodeType != 1) continue;
							if( elem.childNodes[j].nodeName == 'titolo')
								data_obj.titolo = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'id')
								data_obj.id = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'enabled')
								data_obj.enabled = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'autorename')
								data_obj.autorename = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'autore')
								data_obj.autore = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'editorname')
								data_obj.editorname = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'upd_id')
								data_obj.upd_id = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'data_mod')
								data_obj.data_mod = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'deleting')
								data_obj.deleting = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'newrec')
								data_obj.newrec = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'url')
								data_obj.url = elem.childNodes[j].firstChild.nodeValue;
						}
						var tr = new Element('tr');
						var autor = '';
						if(data_obj.editorname && data_obj.editorname!='') 
							autor= '<a href="?id='+data_obj.upd_id+'">'+data_obj.editorname+'</a><br/>';
						autor +='<a href="?id='+data_obj.autore+'">'+data_obj.autorename+'</a>';
						var title = '<a href="'+data_obj.url+'" title="'+data_obj.titolo+'">'+data_obj.titolo+'</a>';
						var stato = 
							(data_obj.upd_id!='-1'?'<span>Nuove Modifiche</span>':'') + 
							(data_obj.deleting!='0'?'<span>Eliminazione richiesta</span>':'')
						;
						
						var td0 = new Element('td');
						var td1 = new Element('td');
						var td2 = new Element('td');
						var td3 = new Element('td');
						var td4 = new Element('td');
						var td5 = new Element('td');						
						td1.set('html', 
								(data_obj.newrec!='0'?'<img src="/administration/template/img/ico_new.gif" alt="new" width="15" />':'') + 
								title);						
						td2.set('html', autor);												
						td3.set('html', '<img src="/administration/template/img/ico_ena_'+data_obj.enabled + '.gif" alt="'+data_obj.enabled+'" width="15" />');																		
						td4.set('html', data_obj.data_mod);					
						td5.set('html', stato);											
						tr.adopt(td1);tr.adopt(td2);tr.adopt(td3);tr.adopt(td4);tr.adopt(td5);
						_tbody.adopt(tr);conto++;
					}
				}
				
					contenitore.adopt(new Element('h6').set('html','Sezioni Modificate di recente') ) ;					
					
				if(conto==0){
					contenitore.adopt(new Element('h6').set('html','Nessuna sezione da visualizzare') ) ;					
					
				}else
					contenitore.adopt(_table);
			} 
		}).send('op=lastsezlist');	
}
function CaricaUltimiUtenti() {
	var myRequest = new Request(
		{
			method: 'get', 
			url: handlerPath,	
			onSuccess: function(text,xml) {
				if(text==null) {alert('no load'); return; }
				if(xml==null) {alert('xml no load'); return; }						
				var cXml;
				if (window.ActiveXObject)
				{
					var xmlObj=new ActiveXObject("Microsoft.XMLDOM");
					xmlObj.async="false";
					xmlObj.loadXML(text);
					if(xmlObj.documentElement == null) {	alert('sono nullo'); return; }
					cXml = xmlObj.documentElement;		
				} else {
					cXml = xml.documentElement;
				}						
				if(cXml == null) { alert('no data');return; }
				var contenitore = $('usersContLast');
				if(!contenitore) {  return; }
				var _table = new Element('table');
				var _tbody = new Element('tbody');
				var _thead = new Element('thead');
				var _trh   = new Element('tr');
				//var htd0 = new Element('td');
				var htd1 = new Element('td');
				var htd2 = new Element('td');
				var htd3 = new Element('td');
				var htd4 = new Element('td');
				var htd5 = new Element('td');				
				//htd0.set('html', ' ');
				htd1.set('html', 'Username');						
				htd2.set('html', 'Online');												
				htd3.set('html', ' ' );																		
				htd4.set('html', 'ult. login');																								
				htd5.set('html', 'stato');																												
				//_trh.adopt(htd0);
				_trh.adopt(htd1);_trh.adopt(htd2);_trh.adopt(htd3);_trh.adopt(htd4);_trh.adopt(htd5);
				_thead.adopt(_trh);
				_table.adopt(_thead);
				_table.adopt(_tbody);
				var conto = 0;
				for(var i = 0 ; i<cXml.childNodes.length; i++ ) {
					if (cXml.childNodes[i].nodeType != 1) continue;
					if( cXml.childNodes[i].nodeName == 'dato') {
						//data_mod,titolo,id, enabled, autorename, autore, editorname, upd_id
						var data_obj = {'username':'', 'id':'','enabled':'', 'data_ins':'', 'isonline':'', 'login_date':'',
										'newrec':'','locked':''
						}
						var elem = cXml.childNodes[i];
						for(var j=0; j<elem.childNodes.length;j++) {
							if (elem.childNodes[j].nodeType != 1) continue;
							if( elem.childNodes[j].nodeName == 'username')
								data_obj.username = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'id')
								data_obj.id = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'enabled')
								data_obj.enabled = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'data_ins')
								data_obj.data_ins = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'isonline')
								data_obj.isonline = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'lastlogindate')
								data_obj.login_date = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'newrec')
								data_obj.newrec = elem.childNodes[j].firstChild.nodeValue;	
							if( elem.childNodes[j].nodeName == 'islockedout')
								data_obj.locked = elem.childNodes[j].firstChild.nodeValue;	
							
						}
						var tr = new Element('tr');
						var isonline = '';
					
						isonline ='<img src="/administration/template/img/onlinestatus_'+data_obj.isonline+'.gif" alt="' +
							(data_obj.isonline!='1'?'offline':'online') + '" width="15" />';
						var title = '<a href="?id='+data_obj.id+'" title="'+data_obj.username+'">'+data_obj.username+'</a>';
						var stato = 
							(data_obj.enabled!='1'?'<span>Disabilitato</span>':'')	+
							(data_obj.locked!='0'?'<span>Bloccato</span>':'');
						
						var td0 = new Element('td');
						var td1 = new Element('td');
						var td2 = new Element('td');
						var td3 = new Element('td');
						var td4 = new Element('td');
						var td5 = new Element('td');						
						td1.set('html', 
								(data_obj.newrec!='0'?'<img src="/administration/template/img/ico_new.gif" alt="new" width="15" />':'') + 
								title);						
						td2.set('html', isonline);												
						td3.set('html', '<img src="/administration/template/img/ico_ena_'+data_obj.enabled + '.gif" alt="'+data_obj.enabled+'" width="15" />');																		
						td4.set('html', data_obj.login_date);					
						td5.set('html', stato);											
						tr.adopt(td1);tr.adopt(td2);tr.adopt(td3);tr.adopt(td4);tr.adopt(td5);
						_tbody.adopt(tr);conto++;
					}
				}
				
					contenitore.adopt(new Element('h6').set('html','Utenti Registrati di recente') ) ;					
					
				if(conto==0){
					contenitore.adopt(new Element('h6').set('html','Nessun utente da visualizzare') ) ;					
					
				}else
					contenitore.adopt(_table);
			} 
		}).send('op=lastuserslist');	
}
function CaricaNuoviUtenti() {
	var myRequest = new Request(
		{
			method: 'get', 
			url: handlerPath,	
			onSuccess: function(text,xml) {
				if(text==null) {alert('no load'); return; }
				if(xml==null) {alert('xml no load'); return; }						
				var cXml;
				if (window.ActiveXObject)
				{
					var xmlObj=new ActiveXObject("Microsoft.XMLDOM");
					xmlObj.async="false";
					xmlObj.loadXML(text);
					if(xmlObj.documentElement == null) {	alert('sono nullo'); return; }
					cXml = xmlObj.documentElement;		
				} else {
					cXml = xml.documentElement;
				}						
				if(cXml == null) { alert('no data');return; }
				var contenitore = $('usersContNew');
				if(!contenitore) { return; }
				var _table = new Element('table');
				var _tbody = new Element('tbody');
				var _thead = new Element('thead');
				var _trh   = new Element('tr');
				//var htd0 = new Element('td');
				var htd1 = new Element('td');
				var htd2 = new Element('td');
				var htd3 = new Element('td');
				var htd4 = new Element('td');
				var htd5 = new Element('td');				
				//htd0.set('html', ' ');
				htd1.set('html', 'Username');						
				htd2.set('html', 'Online');												
				htd3.set('html', ' ' );																		
				htd4.set('html', 'ult. login');																								
				htd5.set('html', 'stato');																												
				//_trh.adopt(htd0);
				_trh.adopt(htd1);_trh.adopt(htd2);_trh.adopt(htd3);_trh.adopt(htd4);_trh.adopt(htd5);
				_thead.adopt(_trh);
				_table.adopt(_thead);
				_table.adopt(_tbody);
				var conto = 0;
				for(var i = 0 ; i<cXml.childNodes.length; i++ ) {
					if (cXml.childNodes[i].nodeType != 1) continue;
					if( cXml.childNodes[i].nodeName == 'dato') {
						//data_mod,titolo,id, enabled, autorename, autore, editorname, upd_id
						var data_obj = {'username':'', 'id':'','enabled':'', 'data_ins':'', 'isonline':'', 'login_date':'',
										'newrec':'','locked':''
						}
						var elem = cXml.childNodes[i];
						for(var j=0; j<elem.childNodes.length;j++) {
							if (elem.childNodes[j].nodeType != 1) continue;
							if( elem.childNodes[j].nodeName == 'username')
								data_obj.username = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'id')
								data_obj.id = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'enabled')
								data_obj.enabled = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'data_ins')
								data_obj.data_ins = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'isonline')
								data_obj.isonline = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'lastlogindate')
								data_obj.login_date = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'newrec')
								data_obj.newrec = elem.childNodes[j].firstChild.nodeValue;	
							if( elem.childNodes[j].nodeName == 'islockedout')
								data_obj.locked = elem.childNodes[j].firstChild.nodeValue;	
							
						}
						var tr = new Element('tr');
						var isonline = '';
						isonline ='<img src="/administration/template/img/onlinestatus_'+data_obj.isonline+'.gif" alt="' +
							(data_obj.isonline!='1'?'offline':'online') + '" width="15" />';
						var title = '<a href="?id='+data_obj.id+'" title="'+data_obj.username+'">'+data_obj.username+'</a>';
						var stato = 
							(data_obj.enabled!='1'?'<span>Da abilitare</span>':'')	+
							(data_obj.locked!='0'?'<span>Bloccato</span>':'')	;							;
						
						var td0 = new Element('td');
						var td1 = new Element('td');
						var td2 = new Element('td');
						var td3 = new Element('td');
						var td4 = new Element('td');
						var td5 = new Element('td');						
						td1.set('html', 
								(data_obj.newrec!='0'?'<img src="/administration/template/img/ico_new.gif" alt="new" width="15" />':'') + 
								title);						
						td2.set('html', isonline);												
						td3.set('html', '<img src="/administration/template/img/ico_ena_'+data_obj.enabled + '.gif" alt="'+data_obj.enabled+'" width="15" />');																		
						td4.set('html', data_obj.login_date);					
						td5.set('html', stato);											
						tr.adopt(td1);tr.adopt(td2);tr.adopt(td3);tr.adopt(td4);tr.adopt(td5);
						_tbody.adopt(tr);conto++;
					}
				}
				
					contenitore.adopt(new Element('h6').set('html','Utenti da abilitare') ) ;					
					
				if(conto==0){
					contenitore.adopt(new Element('h6').set('html','Nessun utente da visualizzare') ) ;					
					
				}else
					contenitore.adopt(_table);
			} 
		}).send('op=newuserslist');	
}
function CaricaUtentiOnline() {
	var myRequest = new Request(
		{
			method: 'get', 
			url: handlerPath,	
			onSuccess: function(text,xml) {
				if(text==null) {alert('no load'); return; }
				if(xml==null) {alert('xml no load'); return; }						
				var cXml;
				if (window.ActiveXObject)
				{
					var xmlObj=new ActiveXObject("Microsoft.XMLDOM");
					xmlObj.async="false";
					xmlObj.loadXML(text);
					if(xmlObj.documentElement == null) {	alert('sono nullo'); return; }
					cXml = xmlObj.documentElement;		
				} else {
					cXml = xml.documentElement;
				}						
				if(cXml == null) { alert('no data');return; }
				var contenitore = $('usersContOnline');
				if(!contenitore) { return; }
				var _table = new Element('table');
				var _tbody = new Element('tbody');
				var _thead = new Element('thead');
				var _trh   = new Element('tr');
				//var htd0 = new Element('td');
				var htd1 = new Element('td');
				var htd2 = new Element('td');
				var htd3 = new Element('td');
						
				//htd0.set('html', ' ');
				htd1.set('html', 'Username');						
				htd2.set('html', 'Online');												
				htd3.set('html', ' ' );																		
																																
				//_trh.adopt(htd0);
				_trh.adopt(htd1);_trh.adopt(htd2);_trh.adopt(htd3);
				_thead.adopt(_trh);
				_table.adopt(_thead);
				_table.adopt(_tbody);
				var conto = 0;
				for(var i = 0 ; i<cXml.childNodes.length; i++ ) {
					if (cXml.childNodes[i].nodeType != 1) continue;
					if( cXml.childNodes[i].nodeName == 'dato') {
						//data_mod,titolo,id, enabled, autorename, autore, editorname, upd_id
						var data_obj = {'username':'', 'id':'','enabled':'', 'data_ins':'', 'isonline':'', 'login_date':'',
										'newrec':'','locked':''
						}
						var elem = cXml.childNodes[i];
						for(var j=0; j<elem.childNodes.length;j++) {
							if (elem.childNodes[j].nodeType != 1) continue;
							if( elem.childNodes[j].nodeName == 'username')
								data_obj.username = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'id')
								data_obj.id = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'enabled')
								data_obj.enabled = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'data_ins')
								data_obj.data_ins = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'isonline')
								data_obj.isonline = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'lastlogindate')
								data_obj.login_date = elem.childNodes[j].firstChild.nodeValue;
							if( elem.childNodes[j].nodeName == 'newrec')
								data_obj.newrec = elem.childNodes[j].firstChild.nodeValue;	
							if( elem.childNodes[j].nodeName == 'islockedout')
								data_obj.locked = elem.childNodes[j].firstChild.nodeValue;	
							
						}
						var tr = new Element('tr');
						var isonline = '';
						isonline ='<img src="/administration/template/img/onlinestatus_'+data_obj.isonline+'.gif" alt="' +
							(data_obj.isonline!='1'?'offline':'online') + '" width="15" />';
						var title = '<a href="?id='+data_obj.id+'" title="'+data_obj.username+'">'+data_obj.username+'</a>';
						var stato = 
							(data_obj.enabled!='1'?'<span>Da abilitare</span>':'')	+
							(data_obj.locked!='0'?'<span>Bloccato</span>':'')	;							;
						
						var td0 = new Element('td');
						var td1 = new Element('td');
						var td2 = new Element('td');
						var td3 = new Element('td');
										
						td1.set('html', 
								(data_obj.newrec!='0'?'<img src="/administration/template/img/ico_new.gif" alt="new" width="15" />':'') + 
								title);						
						td2.set('html', isonline);												
						td3.set('html', '<img src="/administration/template/img/ico_ena_'+data_obj.enabled + '.gif" alt="'+data_obj.enabled+'" width="15" />');																		
															
						tr.adopt(td1);tr.adopt(td2);tr.adopt(td3);
						_tbody.adopt(tr);conto++;
					}
				}
				
					contenitore.adopt(new Element('h6').set('html','Utenti online') ) ;					
					
				if(conto==0){
					contenitore.adopt(new Element('h6').set('html','Nessun utente da visualizzare') ) ;					
					
				}else
					contenitore.adopt(_table);
			} 
		}).send('op=onlineuserslist');	
}

window.addEvent('domready', function() {
	CaricaArticoli();
	CaricaArticoliEdited();
	CaricaCategorie();
	CaricaCategorieEdited();
	CaricaSezioni();
	CaricaSezioniEdited();
	CaricaNuoviUtenti();
	CaricaUltimiUtenti();
	CaricaUtentiOnline();
});